<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>表图标</title>

    <!-- Bootstrap -->
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="bootstrap/css/bootstrap-table.min.css">
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
    <link href="css/colors.min.css" rel="stylesheet">
    <style>
        label input {
            display: inline-block !important;
            width: auto !important;
        }
    </style>

    <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询（media queries）功能 -->
    <!-- 警告：通过 file:// 协议（就是直接将 html 页面拖拽到浏览器中）访问页面时 Respond.js 不起作用 -->
    <!--[if lt IE 9]>
    <script src="bootstrap/js/html5shiv.min.js"></script>
    <script src="bootstrap/js/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<h1>使用<code>icons</code>选项来定义在工具栏，分页和详细信息视图中使用的图标。</h1>
<div>
    <label><span>paginationSwitchDown</span> <input class="form-control" type="text" value="fa-caret-square-down"></label>
</div>
<div>
    <label><span>paginationSwitchUp</span> <input class="form-control" type="text" value="fa-caret-square-up"></label>
</div>
<div>
    <label><span>refresh</span> <input class="form-control" type="text" value="fa-sync"></label>
</div>
<div>
    <label><span>toggleOff</span> <input class="form-control" type="text" value="fa-toggle-off"></label>
</div>
<div>
    <label><span>toggleOn</span> <input class="form-control" type="text" value="fa-toggle-on"></label>
</div>
<div>
    <label><span>columns</span> <input class="form-control" type="text" value="fa-th-list"></label>
</div>
<div>
    <label><span>fullscreen</span> <input class="form-control" type="text" value="fa-arrows-alt"></label>
</div>
<div>
    <label><span>detailOpen</span> <input class="form-control" type="text" value="fa-plus"></label>
</div>
<div>
    <label><span>detailClose</span> <input class="form-control" type="text" value="fa-minus"></label>
</div>

<table
        id="table"
        data-toggle="table"
        data-height="460"
        data-show-pagination-switch="true"
        data-show-refresh="true"
        data-show-toggle="true"
        data-show-columns="true"
        data-show-fullscreen="true"
        data-detail-view="true"
        data-url="json/data1.json">
    <thead>
    <tr>
        <th data-field="id">ID</th>
        <th data-field="name">Item Name</th>
        <th data-field="price">Item Price</th>
    </tr>
    </thead>
</table>

<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
<script src="bootstrap/js/jquery.min.js"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="bootstrap/js/bootstrap.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="bootstrap/js/bootstrap-table.min.js"></script>
<!-- Latest compiled and minified Locales -->
<script src="bootstrap/js/bootstrap-table-zh-CN.min.js"></script>
<script>
    var $table = $('#table')

    $(function() {
        $('label input').blur(function () {
            var icons = {}
            $('label').each(function () {
                icons[$(this).find('span').text()] = $(this).find('input').val()
            })
            $table.bootstrapTable('destroy').bootstrapTable({
                icons: icons
            })
        })
    })
</script>
</body>
</html>